<template>
	<view class="JI_LU">
		<view v-for="(item,index) of list" @click="C_detail(item.team)">
			<image class="thumb" v-if="vuex_httpImageUrl" :src="vuex_httpImageUrl+'static/my/养车图标_预约单 拷贝.png'" mode="widthFix"></image>
			<view>
				<view class="name">
					<text>{{item.medical_name}}</text>
					<text class="state" v-if="item.status == 0">申请中</text>
					<text class="state" v-if="item.status == 1">已同意</text>
					<text class="state" v-if="item.status == 2">已拒绝</text>
				</view>
				<view class="time">预约时间:{{item.appoint_time}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[]
			};
		},
		onShow() {
			this.def_list()
		},
		methods:{
			C_detail(team){
				uni.navigateTo({
					url:'./detail/detail?db='+encodeURIComponent(JSON.stringify(team))
				})
			},
			def_list(page = 1){
				this.$u.post('/appuser/medicals',{page}).then(res=>{
					console.log(res);
					this.list = res.data.list
				})
			}
		}
	}
</script>

<style lang="scss">
	.JI_LU {
		>view {
			background-color: #FFFFFF;
			margin-bottom: 20rpx;
			width: 95%;
			margin: 20rpx auto;
			padding: 30rpx;
			border-radius: 30rpx;
			display: flex;
			align-items: center;
			image {
				margin-right: 20rpx;
				width: 60rpx;
				height: 60rpx;
			}
			>view{
				flex: 1;
				.name{
					display: flex;
					align-items: center;
					justify-content: space-between;
					font-weight: bold;
					font-size: 32rpx;
					.state{
						font-size: 24rpx;
						color: rgba(0,0,0,.5);
					}
				}
				.time{
					font-size: 24rpx;
					color: rgba(0,0,0,.5);
					margin-top: 10rpx;
				}
			}
		}
	}
</style>
